Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue"

$location = [Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$solutionName = "EFWorkflowTimer.wsp"

$sol = Get-SPSolution | Where-Object {$_.Name -eq $solutionName}
if ($sol -ne $null) {
	#if($sol.Deployed -eq $false)
	{	
		#Enable-SPFeature -Identity $featureName -url $webURL -confirm:$false -force
		Enable-SPFeature -Identity "EFWorkflowTimer" -url http://hvsp2010a -confirm:$false -force
		#$targetFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "EFWorkflowTimer"}).Id 
		#$singleSiteCollection = Get-SPSite -Identity http://hvsp2010a Enable-SPFeature $targetFeatureId -Url $singleSiteCollection.URL

		Write-Host "ok"
	}
	#else
	#{
	#	Write-Host "Solution $($solutionName) already deployed."
	#}
}
else
{
	Write-Host "Solution $($solutionName) was not installed, cannot deploy."
}
Write-Host " "
Write-Host "*** Deployment finished ***"
Write-Host " "
Write-Host "Completed.  Any key to exit..."
Read-Host
